package pattern5.leifeng;

/**
 * 简单工厂的方法
 *
 * @author wdl
 */
public class SimpleFactory {
    public static LeiFeng createLeiFeng(String type) {
        LeiFeng result = null;
        switch (type) {
            case "学雷锋的大学生":
                result = new Undegraduate();
                break;
            case "志愿者":
                result = new Volunteer();
                break;
            default:
        }
        return result;
    }
}
